
package com.mephi.model.profile;


import com.mephi.interfaces.LoginManager;
import com.mephi.interfaces.Profile;


/**
 * Simple default implementation which is used to managing the currently logged
 * profile.
 * 
 * @author mephisto
 * @version 1.0
 * 2011-06-04
 */
public enum LoginManagerImpl implements LoginManager
{
	INSTANCE;
	
	/**
	 * 
	 * @return the currentProfile
	 */
	public Profile getCurrentProfile()
	{
		return currentProfile;
	}

	/**
	 * 
	 * @param currentProfile the currentProfile to set
	 */
	public void setCurrentProfile(Profile currentProfile)
	{
		this.currentProfile = currentProfile;
	}
	
	/**
	 * 
	 * @return true if anyone is logged in, false in the other cases
	 */
	public boolean isSomebodyLoggedIn()
	{
		if (currentProfile == null)
			return false;
		return true;
	}
	
	
	private Profile currentProfile;
}
